using System;
using System.ComponentModel.DataAnnotations;

namespace JGSY.CMS.LowCode.Platform.Application.DTOs
{
    /// <summary>
    /// 页面数据传输对象
    /// 用于传输页面相关的数据信息，包括页面内容、SEO设置、层级结构等
    /// </summary>
    public class PageDto
    {
        /// <summary>
        /// 页面ID
        /// </summary>
        public long Id { get; set; }

        /// <summary>
        /// 页面标题
        /// </summary>
        [Required(ErrorMessage = "页面标题不能为空")]
        [StringLength(255, ErrorMessage = "页面标题长度不能超过255个字符")]
        public string Title { get; set; } = string.Empty;

        /// <summary>
        /// 页面别名/URL slug
        /// </summary>
        [StringLength(255, ErrorMessage = "页面别名长度不能超过255个字符")]
        public string? Slug { get; set; }

        /// <summary>
        /// 父页面ID
        /// </summary>
        public long? ParentId { get; set; }

        /// <summary>
        /// 模板ID
        /// </summary>
        public long? TemplateId { get; set; }

        /// <summary>
        /// 页面内容
        /// </summary>
        public string? Content { get; set; }

        /// <summary>
        /// 页面描述
        /// </summary>
        [StringLength(500, ErrorMessage = "页面描述长度不能超过500个字符")]
        public string? Description { get; set; }

        /// <summary>
        /// 页面标签（JSON格式）
        /// </summary>
        public string? Tags { get; set; }

        /// <summary>
        /// SEO标题
        /// </summary>
        [StringLength(255, ErrorMessage = "SEO标题长度不能超过255个字符")]
        public string? SeoTitle { get; set; }

        /// <summary>
        /// SEO关键词
        /// </summary>
        [StringLength(500, ErrorMessage = "SEO关键词长度不能超过500个字符")]
        public string? SeoKeywords { get; set; }

        /// <summary>
        /// SEO描述
        /// </summary>
        [StringLength(500, ErrorMessage = "SEO描述长度不能超过500个字符")]
        public string? SeoDescription { get; set; }

        /// <summary>
        /// 自定义属性
        /// </summary>
        public string? CustomFields { get; set; }

        /// <summary>
        /// 排序权重
        /// </summary>
        public int SortOrder { get; set; }

        /// <summary>
        /// 访问量
        /// </summary>
        public int ViewCount { get; set; }

        /// <summary>
        /// 是否在导航中显示
        /// </summary>
        public bool ShowInNavigation { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        public byte Status { get; set; }

        /// <summary>
        /// 版本号
        /// </summary>
        public int Version { get; set; }

        /// <summary>
        /// 创建人ID
        /// </summary>
        public long CreatedBy { get; set; }

        /// <summary>
        /// 修改人ID
        /// </summary>
        public long? UpdatedBy { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedAt { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime UpdatedAt { get; set; }

        /// <summary>
        /// 创建人姓名
        /// </summary>
        public string? CreatorName { get; set; }

        /// <summary>
        /// 修改人姓名
        /// </summary>
        public string? UpdaterName { get; set; }

        /// <summary>
        /// 父页面标题
        /// </summary>
        public string? ParentTitle { get; set; }

        /// <summary>
        /// 模板名称
        /// </summary>
        public string? TemplateName { get; set; }
    }
}
